import axios from "axios";
import {urlConfig} from "../Config";
import dayjs from "dayjs";

const fetchBusNo = async (startS: string, endS: string, fromTime: Date) => {
    const msg = await axios.get(urlConfig.getUrlFor("/bus-no", {
        startS,
        endS,
        fromTime: dayjs(fromTime, ).format("YYYY-MM-DD 00:00:00"),
        start:0,
        size: -1
    }));
    return msg.data.result;
}

const fetchBuNoById = async (id: any) => {
  const msg = await axios.get(urlConfig.getUrlFor("/bus-no",{
      id,
      start:0,
      size: -1
  }));
  return msg.data.result;
}

export {fetchBusNo, fetchBuNoById}